/* Copyright (c) 2004-2024 Peigen.info. All rights reserved. */

package info.peigen.hotpot.business.customer.core.service.processor.partner;

import cn.hutool.core.util.ObjectUtil;
import info.peigen.hotpot.business.customer.core.domain.partner.Partner;
import info.peigen.hotpot.business.customer.core.domain.partner.action.PartnerConverter;
import info.peigen.hotpot.business.customer.core.service.processor.base.AbstractCustomerServiceProcessor;
import info.peigen.hotpot.business.customer.facade.result.partner.PartnerApplyTechResult;
import info.peigen.hotpot.common.service.base.processor.Processor;
import info.peigen.hotpot.common.service.base.processor.ProcessorServiceContext;
import org.noear.solon.annotation.Component;

/**
 * <b>(PartnerApplyPermissionResultProcessor)</b>
 *
 * @author Lihai
 * @version 1.0.0
 * @since 2022/5/26
 */
@Component
public class PartnerApplyTechResultProcessor extends AbstractCustomerServiceProcessor implements Processor {
    @Override
    public Integer level() {
        return 91;
    }

    @Override
    public void execute(ProcessorServiceContext serviceContext) {
        Partner partner = (Partner) serviceContext.getDomain();
        if (ObjectUtil.isNotNull(partner)) {
            PartnerApplyTechResult result = (PartnerApplyTechResult) serviceContext.getResult();
            result.fromSuccess(PartnerConverter.convertInfo(partner));
        }
    }
}
